/* 数字人播放器容器 */
.avatar-player-container {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 320px;
    height: 240px;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    display: none;
}

/* 显示容器 */
.avatar-player-container.loading,
.avatar-player-container.playing,
.avatar-player-container.error {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 数字人视频元素 */
.avatar-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: transparent;
}

/* 加载中状态 */
.avatar-player-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    z-index: 2;
}

.avatar-player-container.loading .avatar-player-loader {
    display: flex;
}

/* 加载动画 */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: #fff;
}

/* 错误状态 */
.avatar-player-container.error {
    background-color: rgba(0, 0, 0, 0.9);
}

.avatar-player-container.error .avatar-player {
    display: none;
}

.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-align: center;
    width: 80%;
    font-size: 14px;
    line-height: 1.4;
    z-index: 2;
}

/* 重试按钮 */
.retry-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    color: var(--danger-color);
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    z-index: 2;
}

.retry-button:hover {
    background-color: #f8f9fa;
    transform: translateX(-50%) scale(1.05);
}

/* 关闭按钮 */
.avatar-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1001;
}

.avatar-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* 需要用户交互状态 */
.avatar-player-container.need-interaction::after {
    content: "点击播放";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
}

/* 调整语音播报弹窗和数字人的位置关系 */
.avatar-player-container.playing + .voice-popup {
    bottom: 340px;
} 